package com.hzncc.flowable_diboot.vo;

import com.diboot.core.binding.annotation.BindField;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.entity.FormDesign;
import com.hzncc.flowable_diboot.entity.OppoFlowOrder;
import com.hzncc.flowable_diboot.entity.OppoFlowOrderItem;
import com.hzncc.flowable_diboot.entity.OppoFlowTemplateItem;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 商机流程项 VO定义
 *
 * @author MyName
 * @version 1.0
 * @date 2024-06-18
 * Copyright © MyCorp
 */
@Getter
@Setter
@Accessors(chain = true)
public class OppoFlowOrderItemListVO extends OppoFlowOrderItem {
    private static final long serialVersionUID = 1846777781021063790L;
    /**
     * 单据id 关联信息
     */

    @BindField(
            entity = OppoFlowOrder.class,
            field = "code",
            condition = "this.order_id = id"
    )
    private String orderIdLabel;

    /**
     * 模板项id 关联信息
     */

    @BindField(
            entity = OppoFlowTemplateItem.class,
            field = "name",
            condition = "this.template_item_id = id"
    )
    private String templateItemIdLabel;

    /**
     * 上一节点 关联信息
     */

    @BindField(
            entity = OppoFlowOrderItem.class,
            field = "code",
            condition = "this.prev = id"
    )
    private String prevLabel;

    /**
     * 下一节点 关联信息
     */

    @BindField(
            entity = OppoFlowOrderItem.class,
            field = "name",
            condition = "this.next = id"
    )
    private String nextLabel;

    /**
     * 创建人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.create_by = id"
    )
    private String createByLabel;

    /**
     * 更新人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.update_by = id"
    )
    private String updateByLabel;

    /**
     * 表单规则
     */
    @BindField(entity = FormDesign.class, field = "customerFormRule", condition = "this.form_id = id")
    private String formRule;

    /**
     * 表单项
     */
    @BindField(entity = FormDesign.class, field = "customerFormOptions", condition = "this.form_id = id")
    private String formOptions;
}